package com.dqx.haoqiu.repository.repository.user.remote;

import android.content.Context;

import com.dqx.haoqiu.repository.api.UserApi;
import com.dqx.haoqiu.repository.entity.TokenEntity;
import com.dqx.haoqiu.repository.entity.UserEntity;
import com.dqx.haoqiu.repository.repository.user.UserSource;
import com.xmjs.baselibrary.utils.SP;

import javax.inject.Inject;

import io.reactivex.Observable;

/**
 * 远程数据源：可以结合网络请求框架来存取数据（这里集成的是Retrofit框架）
 */
public class UserRemoteSource implements UserSource {

    private final UserApi mUserApi;
    private final Context mContext;
    private final SP mSP;

    @Inject
    UserRemoteSource(Context context, UserApi userApi, SP sp) {
        this.mContext = context;
        this.mUserApi = userApi;
        this.mSP = sp;
    }

    @Override
    public Observable<TokenEntity> login(String username, String password) {
        return mUserApi.login(username,password);
    }

    @Override
    public Observable<UserEntity> getUserInfo() {
        return mUserApi.getUserInfo();
    }

    @Override
    public void setShowGuide(boolean show) {

    }

    @Override
    public boolean showGuide() {
        return false;
    }

    @Override
    public void setShowPrivaceDialog(boolean show) {

    }

    @Override
    public boolean showPrivaceDialog() {
        return false;
    }
}